package com.lesson16.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FunctionController {
	
	@RequestMapping("/func/random")
	public Map<String, Object> random(String random){
		 Map<String, Object> results = new HashMap<String, Object>();
		 results.put("code", "000000");
		 results.put("msg", "success");
		 results.put("body", random);
		 System.out.println(random);
		 return results; 
	}
	
	@RequestMapping("/func/uuid")
	public Map<String, Object> uuid(String uuid){
		 Map<String, Object> results = new HashMap<String, Object>();
		 results.put("code", "000000");
		 results.put("msg", "success");
		 results.put("body", uuid);
		 System.out.println(uuid);
		 return results; 
	}
	
	@RequestMapping("/func/csvReader")
	public Map<String, Object> csvReader(String username, String password){
		 Map<String, Object> results = new HashMap<String, Object>();
		 results.put("code", "000000");
		 results.put("msg", "success");
		 results.put("username", username);
		 results.put("password", password);
		 System.out.println(username +", "+ password);
		 return results; 
	}

}
